
package net.phoenix.repository.query.qom2;

import javax.jcr.query.qom.BindVariableValue;


/**
 * <code>BindVariableValueImpl</code>...
 */
public class BindVariableValueImpl
        extends StaticOperandImpl
        implements BindVariableValue {

    /**
     * The name of the bind variable.
     */
    private final String variableName;

    BindVariableValueImpl(NamePathResolver resolver, String variableName) {
        super(resolver);
        this.variableName = variableName;
    }

 

    //-------------------------< BindVariableValue >----------------------------

    /**
     * Gets the name of the bind variable.
     *
     * @return the bind variable name; non-null
     */
    public String getBindVariableName() {
        return variableName;
    }

    //------------------------< AbstractQOMNode >-------------------------------

    /**
     * Accepts a <code>visitor</code> and calls the appropriate visit method
     * depending on the type of this QOM node.
     *
     * @param visitor the visitor.
     */
    public Object accept(QOMTreeVisitor visitor, Object data) throws Exception {
        return visitor.visit(this, data);
    }

    //------------------------< Object >----------------------------------------

    public String toString() {
        return getBindVariableName();
    }

}
